<template>
  <div id='tmpl'>
      <mt-swipe :auto='2000'>
            <!--<mt-swipe-item>1</mt-swipe-item>
                    <mt-swipe-item>2</mt-swipe-item>
                    <mt-swipe-item>3</mt-swipe-item>-->
            <mt-swipe-item v-for="item in list">
                <img :src='item.img'>
            </mt-swipe-item>
        </mt-swipe>
  </div>
</template>
<script>
import { Toast } from 'mint-ui';

export default {
    props: ['url'],
    data () {
        return {
            list:[]
        };
    },
    created(){
        this.getImages(this.url);
    },
    methods:{
        getImages(url){           
            // const dizhi = this.$common.apidomain + url;
            this.$http.get(url).then(function(response){
                const data = response.body;

                if(data.status != 0){
                    Toast(data.message);
                    return;
                }

                this.list = data.message;
                // console.log(this.list)
            })
        }
    }
    
}
</script>
<style lang="css" scoped>
.mint-swipe {
    height: 300px;
}

.mint-swipe-item {
    background-color: red;
    width: 100%;
    height: 300px;
}

.mint-swipe-item img {
    width: 100%;
    height: 300px;
    display: block;
}
</style>